<script language="JavaScript" type="text/javascript">
$(document).ready(function (){
	show_menu('文章列表');	
})
</script>
		<?php if($this->session->flashdata('success_message')):?>
		<div id="succeed" style="clear: right"><?=$this->session->flashdata('success_message');?></div>
		<?
			echo "<script>setTimeout(function (){document.getElementById('succeed').style.display = 'none';}, 5000)</script>";
		?>
		<?php endif;?>			
		
		<div class="box">
			<h3>Table Sample</h3>
			<table>
			<thead>
			<tr>
				<th scope="col">发布日期</th>
				<th scope="col">文章名</th>
				<th scope="col">分类</th>
				<th scope="col">排序</th>
				<th scope="col">状态</th>
				<th scope="col">操作</th>
			</tr>
			</thead>
			<tbody>
			<?
			$tr_class = '';
			foreach ($post_records as $post_record):
			$tr_class = $tr_class == '' ? 'odd' : '';
			?>
			<tr class="<?=$tr_class?>">
				<td><?=date('Y-m-d', strtotime($post_record->create))?></td>
				<td><?=$post_record->name?></td>
				<td><?=$post_type_records[$post_record->typeid]?></td>
				<td><?=$post_record->order?></td>
				<td>
				<? if ($post_record->status): ?>
					<span class="active">显示</span>
					<? else: ?>
					<span class="closed">隐藏</span>
				<? endif; ?>
				</td>
				<?
					if ($post_record->status) {
						$status_html = '<a href="' . site_url("admin/post_disable/{$post_record->id}") . '" onclick="return confirm(\'确定要隐藏吗？\')">隐藏</a>';
					} else {
						$status_html = '<a href="' . site_url("admin/post_enable/{$post_record->id}") . '" onclick="return confirm(\'确定要显示吗？\')">显示</a>';
					}
					?>
				<td><a href="<?=site_url('admin/post/' . $post_record->id)?>">编辑</a> | <?=$status_html?> | <a href="<?=site_url('admin/post_delete/' . $post_record->id)?>" onclick="return confirm('确定要删除吗？')">删除</a></td>
			</tr>
			<? endforeach; ?>
			</tbody>
			</table>
			
			<div class="pagination">
            	<ul>	   
                	<li class="pages">Page:</li>
					<li>1</li>
					<li><a href="#" >2</a></li>
					<li><a href="#" >3</a></li>
					<li><a href="#" >4</a></li>
					<li><a href="#" >5</a></li>
					<li>...</li>
					<li><a href="#" >10</a></li>
				</ul>
            </div>

		</div>